<template>
  <el-config-provider :locale="zhCn" :size="store.app.size">
    <router-view />
  </el-config-provider>
</template>

<script setup>
import zhCn from "element-plus/es/locale/lang/zh-cn"
import store from '@/store/index.js'


// 根据路由和配置动态设置页面标题
watchEffect(() => {
  const dynamicTitle = store.settings.dynamicTitle
  if (!dynamicTitle) return document.title = import.meta.env.VITE_APP_TITLE
  const title = store.settings.title
  if (title === undefined || title === null || title === '') return document.title = import.meta.env.VITE_APP_TITLE
  document.title = title + ' - ' + import.meta.env.VITE_APP_TITLE
}, {lazy: true})
</script>
